//
//  ShopProductCollectionViewCell.m
//  FaceTo
//
//  Created by 程邦明 on 2017/8/7.
//  Copyright © 2017年 chengbangming. All rights reserved.
//

#import "ShopProductCollectionViewCell.h"

@implementation ShopProductCollectionViewCell
- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    
    if (self){
        [self initUI];
    }
    return self;
}
- (void)initUI{
    self.backgroundColor = WhiteColor;
    
    _headImage = [[UIImageView alloc]init];
    _headImage.image = [UIImage imageNamed:@"useicon"];
//    _headImage.backgroundColor = [UIColor redColor];
    [self addSubview:_headImage];
    
    _nameLabel = [[UILabel alloc]init];
    _nameLabel.font = [UIFont systemFontOfSize:15];
    _nameLabel.textColor = Color(51, 51, 51);
    _nameLabel.textAlignment = NSTextAlignmentLeft;
    _nameLabel.text = @"商品名称";
    [self addSubview:_nameLabel];
    
    _shengLabel = [[UILabel alloc]init];
    _shengLabel.font = [UIFont systemFontOfSize:13];
    _shengLabel.textColor = Color(51, 51, 51);
    _shengLabel.textAlignment = NSTextAlignmentLeft;
    _shengLabel.text = @"剩余5件";
    [self addSubview:_shengLabel];
    
    _moneyLabel = [[UILabel alloc]init];
    _moneyLabel.font = [UIFont systemFontOfSize:16];
    _moneyLabel.textColor = Color(247, 214, 73);
    _moneyLabel.textAlignment = NSTextAlignmentLeft;
    _moneyLabel.text = @"300+10¥";
    [self addSubview:_moneyLabel];
    
    [_headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(0);
        make.right.offset(0);
        make.top.offset(0);
        make.height.mas_equalTo(150);
    }];
    
    [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.top.equalTo(_headImage.mas_bottom).with.offset(10);
        make.height.mas_equalTo(16);
    }];
    
    [_shengLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_nameLabel.mas_right).with.offset(10);
        make.centerY.equalTo(_nameLabel.mas_centerY);
        make.height.mas_equalTo(14);
    }];
    
    [_moneyLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.height.mas_equalTo(17);
        make.top.equalTo(_nameLabel.mas_bottom).with.offset(15);
    }];
    
    
}
@end
